define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'crm/customer.open_sea/index',
        import_url: 'crm/customer.open_sea/import',
        receive_url: 'crm/customer.open_sea/receive',
    };

    var Controller = {

        index: function () {

            ea.table.render({
                init: init,
				toolbar:['refresh', 'import'],
                cols: [[
                    { type: "checkbox", width: 50 },
                    { field: 'id', width: 60, title: 'ID', sort: true, search:false},
                    { field: 'name', title: '客户名称' ,width: 100},   
                    { field: 'level.name', title: '客户级别' ,width: 100},   
                    { field: 'industry.name', title: '行业' ,width: 100},   
					{ field: 'source.name', title: '来源' ,width: 100},   
					{ field: 'mobile', title: '手机' ,width: 120}, 
                    { field: 'remark', width: 250,title: '备注',search:false },   
					{ field: 'create_user.username', title: '创建人' ,width: 100}, 
					{ field: 'next_time', title: '下次跟进' ,width: 160},
					{ field: 'weixin', title: '微信' ,width: 100},
                    { field: 'create_time',  title: '创建时间',width: 160,search:false},
					{ field: 'collect_time',  title: '领取时间',width: 160,search:false},
					{ field: 'deal_status', title: '状态' ,width: 100},
					{
						width: 100,
						title: '操作',
						align: "center",
						fixed: 'right',
						templet: ea.table.tool,
						operat: [
							'receive'
						]
					}
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
        import: function () {
            ea.listen();
        }
    };
    return Controller;
});